

<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Inkycal &mdash; inkycal 2.0.4 documentation</title>
      <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
      <link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />

  
      <script src="_static/jquery.js?v=5d32c60e"></script>
      <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
      <script src="_static/documentation_options.js?v=adc66a14"></script>
      <script src="_static/doctools.js?v=9bcbadda"></script>
      <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="_static/js/theme.js"></script>
    <link rel="author" title="About these documents" href="about.html" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="About Inkycal" href="about.html" />
    <link rel="prev" title="Inkycal documentation" href="index.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="index.html" class="icon icon-home">
            inkycal
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Inkycal</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#inkycal.main.Inkycal"><code class="docutils literal notranslate"><span class="pre">Inkycal</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#inkycal.main.Inkycal.calibrate"><code class="docutils literal notranslate"><span class="pre">Inkycal.calibrate()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#inkycal.main.Inkycal.countdown"><code class="docutils literal notranslate"><span class="pre">Inkycal.countdown()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#inkycal.main.Inkycal.dry_run"><code class="docutils literal notranslate"><span class="pre">Inkycal.dry_run()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#inkycal.main.Inkycal.process_module"><code class="docutils literal notranslate"><span class="pre">Inkycal.process_module()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#inkycal.main.Inkycal.run"><code class="docutils literal notranslate"><span class="pre">Inkycal.run()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#inkycal.main.load_module_class"><code class="docutils literal notranslate"><span class="pre">load_module_class()</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#module-inkycal.display.Display">Display</a></li>
<li class="toctree-l1"><a class="reference internal" href="#custom-functions">Custom functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="#helper-classes">Helper classes</a></li>
<li class="toctree-l1"><a class="reference internal" href="about.html">About Inkycal</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="dev_doc.html">Developer documentation</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">inkycal</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">Inkycal</li>
      <li class="wy-breadcrumbs-aside">
            <a href="_sources/inkycal.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <img alt="logo" class="align-center" src="https://raw.githubusercontent.com/aceisace/Inkycal/assets/Repo/logo.png" />
<section id="module-inkycal.main">
<span id="inkycal"></span><h1>Inkycal<a class="headerlink" href="#module-inkycal.main" title="Link to this heading"></a></h1>
<p>Main class for inkycal Project
Copyright by aceinnolab</p>
<dl class="py class">
<dt class="sig sig-object py" id="inkycal.main.Inkycal">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">inkycal.main.</span></span><span class="sig-name descname"><span class="pre">Inkycal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">settings_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">render</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_pi_sugar</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shutdown_after_run</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#inkycal.main.Inkycal" title="Link to this definition"></a></dt>
<dd><p>Inkycal main class</p>
<p>Main class of Inkycal, test and run the main Inkycal program.</p>
<dl class="simple">
<dt>Args:</dt><dd><ul class="simple">
<li><p>settings_path = str -&gt; the full path to your settings.json file
if no path is given, tries looking for settings file in /boot folder.</p></li>
<li><p>render = bool (True/False) -&gt; show the image on the epaper display?</p></li>
</ul>
</dd>
<dt>Attributes:</dt><dd><ul class="simple">
<li><p>optimize = True/False. Reduce number of colours on the generated image
to improve rendering on E-Papers. Set this to False for 9.7” E-Paper.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="inkycal.main.Inkycal.calibrate">
<span class="sig-name descname"><span class="pre">calibrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cycles</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">3</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#inkycal.main.Inkycal.calibrate" title="Link to this definition"></a></dt>
<dd><p>Calibrate the E-Paper display</p>
<p>Uses the Display class to calibrate the display with the default of 3
cycles. After a refresh cycle, a new image is generated and shown.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="inkycal.main.Inkycal.countdown">
<span class="sig-name descname"><span class="pre">countdown</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">interval_mins</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">int</span></span></span><a class="headerlink" href="#inkycal.main.Inkycal.countdown" title="Link to this definition"></a></dt>
<dd><p>Returns the remaining time in seconds until the next display update based on the interval.</p>
<dl class="simple">
<dt>Args:</dt><dd><dl class="simple">
<dt>interval_mins (int): The interval in minutes for the update. If none is given, the value</dt><dd><p>from the settings file is used.</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><p>int: The remaining time in seconds until the next update.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="inkycal.main.Inkycal.dry_run">
<span class="sig-name descname"><span class="pre">dry_run</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#inkycal.main.Inkycal.dry_run" title="Link to this definition"></a></dt>
<dd><p>Tests if Inkycal can run without issues.</p>
<p>Attempts to import module names from settings file. Loads the config
for each module and initializes the module. Tries to run the module and
checks if the images could be generated correctly.</p>
<p>Generated images can be found in the /images folder of Inkycal.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="inkycal.main.Inkycal.process_module">
<span class="sig-name descname"><span class="pre">process_module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">number</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#inkycal.main.Inkycal.process_module" title="Link to this definition"></a></dt>
<dd><p>Process individual module to generate images and handle exceptions.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="inkycal.main.Inkycal.run">
<em class="property"><span class="k"><span class="pre">async</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">run_once</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#inkycal.main.Inkycal.run" title="Link to this definition"></a></dt>
<dd><p>Runs main program in nonstop mode or a single iteration based on the run_once flag.</p>
<dl class="simple">
<dt>Args:</dt><dd><dl class="simple">
<dt>run_once (bool): If True, runs the updating process once and stops. If False,</dt><dd><p>runs indefinitely.</p>
</dd>
</dl>
</dd>
</dl>
<p>Uses an infinity loop to run Inkycal nonstop or a single time based on run_once.
Inkycal generates the image from all modules, assembles them in one image,
refreshes the E-Paper and then sleeps until the next scheduled update or exits.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="inkycal.main.load_module_class">
<span class="sig-prename descclassname"><span class="pre">inkycal.main.</span></span><span class="sig-name descname"><span class="pre">load_module_class</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dotted_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#inkycal.main.load_module_class" title="Link to this definition"></a></dt>
<dd><p>Load a class from a dotted import path.
Example: “inkycal.modules.inkycal_weather.Weather”</p>
</dd></dl>

</section>
<section id="module-inkycal.display.Display">
<span id="display"></span><h1>Display<a class="headerlink" href="#module-inkycal.display.Display" title="Link to this heading"></a></h1>
<p>Display class for inkycal</p>
<p>Creates an instance of the driver for the selected E-Paper model and allows
rendering images and calibrating the E-Paper display</p>
<dl class="simple">
<dt>Args:</dt><dd><ul class="simple">
<li><p>epaper_model: The name of your E-Paper model.</p></li>
</ul>
</dd>
</dl>
</section>
<section id="custom-functions">
<h1>Custom functions<a class="headerlink" href="#custom-functions" title="Link to this heading"></a></h1>
</section>
<section id="helper-classes">
<h1>Helper classes<a class="headerlink" href="#helper-classes" title="Link to this heading"></a></h1>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="index.html" class="btn btn-neutral float-left" title="Inkycal documentation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="about.html" class="btn btn-neutral float-right" title="About Inkycal" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2018-2023, aceinnolab.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>